<!DOCTYPE html>
<html lang="zh-cn">
	<head>
	<meta charset="utf-8">
	<title>导航栏</title>
	<link href="learn1.css" type="text/css" rel="stylesheet">
	</head>
	<body>
		
		<script type="text/javascript">
		var menuids=["suckertreel"];
	function buildsubmenus(){
		for(var i=0;i<menuids.length;i++){
			
			var  ultags=document.getElementById(menuids[i]).getElementsByTagName("ul");
			
			for(var t=0;t<ultags.length;t++){
				
				ultags[t].parentNode.onmouseover=function(){
					
					this.getElementsByTagName("ul")[0].style.display="block";
					this.firstChild.style.backgroundColor="green";
				}
				ultags[t].parentNode.onmouseout=function(){
					this.getElementsByTagName("ul")[0].style.display="none";
					this.firstChild.style.backgroundColor="";				}
			}
		}
	}
	if(window.addEventListener)
	{
		window.addEventListener("load",buildsubmenus,false);
		alert('1');
		
		
	}
	else if(window.attachEvent)
	{
		window.attachEvent("onload",buildsubmenus);
		
	}
		</script>
		<div class="suckerdiv">
			<ul id="suckertreel">
				<li><a href="#">关于我们</a></li>
				<li><a href="#">企业新闻</a></li>
				<li><a href="#">企业文化</a></li>
				<li><a href="#">产品介绍</a>
				<ul>
					<li><a href="#">手机</a></li>
					<li><a href="#">笔记本</a></li>
					<li><a href="#">数码相机</a></li>
					<li><a href="#">台式机</a></li>
					<li><a href="#">打印机</a></li>
					<li><a href="#">办公耗材</a></li>
				</ul>
				</li>
			</ul>
		</div>
	</body>
</html>